import { useSelector } from 'react-redux'
import { RootState } from '@redux/reducer'

const useReducer:<T>(reducer: keyof RootState) => T = (reducer: keyof RootState) => {
  const store: any = useSelector<RootState>(state => state[reducer])
  return store
}

export default useReducer
